package com.zm.tools.validate;

/**
 * Description:验证结果实体
 * Created by zoum on 2017/6/5 17:08.
 */
public class ValidateResult {

    private boolean pass;

    private String message;


    public ValidateResult(){}

    public ValidateResult(boolean pass, String message){
        this.pass = pass;
        this.message = message;
    }

    public boolean isPass() {
        return pass;
    }

    public boolean noPass(){
        return !pass;
    }

    public void setPass(boolean pass) {
        this.pass = pass;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static ValidateResult success(){
        return new ValidateResult(true, "");
    }

    public static ValidateResult error(String message){
        return new ValidateResult(false, message);
    }
}
